{{include file="header_inc.html"}}
<script type="text/javascript">
	$(document).ready(function() {
		window.top.$('#display_center_id').css('display', 'none');

		Calendar.setup({
			weekNumbers : true,
			inputField : "start_uploadtime",
			trigger : "start_uploadtime",
			dateFormat : "%Y-%m-%d %H:%M:%S",
			showTime : true,
			minuteStep : 1,
			onSelect : function() {
				this.hide();
			}
		});

		Calendar.setup({
			weekNumbers : true,
			inputField : "end_uploadtime",
			trigger : "end_uploadtime",
			dateFormat : "%Y-%m-%d",
			showTime : false,
			minuteStep : 1,
			onSelect : function() {
				this.hide();
			}
		});
	});

	function hoverUse(target) {
		if ($("#" + target).css("display") == "none") {
			$("#" + target).show();
		} else {
			$("#" + target).hide();
		}
	}

	function preview(id, name, filepath) {
		if (IsImg(filepath)) {
			window.top.art
					.dialog({
						title : '预览',
						fixed : true,
						content : '<img src="'
								+ filepath
								+ '" onload="$(this).LoadImage(true, 500, 500,\'{{#siteImgPath#}}/s_nopic.gif\');"/>'
					});
		} else {
			window.top.art
					.dialog({
						title : '预览',
						fixed : true,
						content : '<a href="'+filepath+'" target="_blank"/><img src="{{#siteImgPath#}}/admin_img/down.gif">单击打开</a>'
					});
		}
	}

	function IsImg(url) {
		var sTemp;
		var b = false;
		var opt = "jpg|gif|png|bmp|jpeg";
		var s = opt.toUpperCase().split("|");
		for ( var i = 0; i < s.length; i++) {
			sTemp = url.substr(url.length - s[i].length - 1);
			sTemp = sTemp.toUpperCase();
			s[i] = "." + s[i];
			if (s[i] == sTemp) {
				b = true;
				break;
			}
		}
		return b;
	}
</script>
<body>
	<div class="subnav">
		<div class="content-menu ib-a blue line-x">
			<a href='javascript:;' class="on"><em>附件管理</em></a>
		</div>
	</div>
	<div class="pad-lr-10">
		<form name="searchform" action="" method="get">
			<table width="100%" cellspacing="0" class="search-form">
				<tbody>
					<tr>
						<td><div class="explain-col">
								名称 <input type="text" value="" class="input-text"
									name="filename"> 上传时间 <input type="text"
									name="start_uploadtime" id="start_uploadtime" value=""
									size="20" class="date" readonly>&nbsp; 至 <input
									type="text" name="end_uploadtime" id="end_uploadtime" value=""
									size="20" class="date" readonly>&nbsp; 附件类型 <input
									type="text" value="" class="input-text" name="fileext">
								<input type="submit" value="搜索" class="button" name="dosubmit">
							</div></td>
					</tr>
				</tbody>
			</table>
		</form>
		<div class="table-list">
			<form name="myform" action="" method="post" id="myform">
				<table width="100%" cellspacing="0">
					<thead>
						<tr>
							<th width="5%"><input type="checkbox" value=""
								id="check_box" onclick="selectall('ids[]');"></th>
							<th width="5%">ID</th>
							<th width="8%">栏目名称</th>
							<th width="20%">附件名称</th>
							<th width="10%">附件大小</th>
							<th width="10%">附件说明</th>
							<th width="20%">上传时间</th>
							<th width="15%">管理操作</th>
						</tr>
					</thead>
					<tbody>
						{{foreach item=content from=$Image_list}}
						<tr>
							<td align="center"><input class="inputcheckbox "
								name="ids[]" value="{{$content.attach_id}}" type="checkbox"></td>
							<td align="center">{{$content.attach_id}}</td>
							<td align="center">{{$content.attach_type_desc}}</td>
							<td align="center">{{if $content.ext=='jpg' ||
								$content.ext=='gif' || $content.ext=='jpeg' ||
								$content.ext=='png' || $content.ext=='bmp'}}<img
								src="{{#siteImgPath#}}/ext/jpg.gif" />{{/if}}{{$content.save_name}}.{{$content.ext}}
							</td>
							<td align="center">{{$content.filesize}}</td>
							<td align="center">{{$content.description}}</td>
							<td align="center">{{$content.ctime}}</td>
							<td align='center'><a href="javascript:;"
								onclick="preview('{{$content.attach_id}}','{{$content.save_name}}.{{$content.ext}}','{{#siteUploadPath#}}/{{$content.attach_type}}/{{$content.save_location}}/{{$content.save_name}}.{{$content.ext}}')">查看</a>
								| <a href="javascript:;">删除</a></td>
						</tr>
						{{/foreach}}
					</tbody>
				</table>
				<div class="btn">
					<input type="submit" class="button" name="dosubmit" value="删除" />
				</div>
				<div id="pages">{{$pageBlock}}</div>
			</form>
		</div>
	</div>
</body>
</html>
{{include file="footer.html"}}
